package tds.model21;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * @Company 杭州先锋电子技术股份有限公司
 * @ClassName Client
 * @Description TODO（这里用一句话描述这个类的作用)
 * @author tds
 * @Date 2020/2/5 19:32
 * @version 1.0.0
 */
public class Client {
    public static void main(String[] args) {
//        List<String> list = new ArrayList<>();
//        list.iterator()

        MyAggregate myAggregate = new MyAggregate();
        myAggregate.addObject("123");
        myAggregate.addObject("xxxx");
        myAggregate.addObject("eee");

        MyIterator iterator = myAggregate.createIterator();
        while(iterator.hasNext()){
            System.out.println(iterator.getCurrentObj());
            iterator.next();
        }


    }
}
